# -*- coding:utf-8 -*-
#设置编码，防止中文乱码
from django.shortcuts import render
import time
import configparser
#导入,可以使此次请求忽略csrf校验
from django.views.decorators.csrf import csrf_exempt
from django.http import JsonResponse
from rasa_nlu import utils, config
from rasa_nlu.train import train as do_train
import os

def test(request):
    path = os.getcwd()
    print(os.path.dirname(path))
    print(os.path.split(os.path.abspath(__file__)))
    do_train(config.load(os.path.dirname(path)+"/rasa_nlu_test/sample_configs/config_jieba_mitie_sklearn_plus_dict_path.yml"),
             os.path.dirname(path)+"/rasa_nlu_test/data/test/demo-rasa-zh.json",
             os.path.dirname(path)+"/rasa_nlu_test/models",
             None,
             None,
             None,
             None,
             num_threads=1)
    return JsonResponse({"a":"b"})
